<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pymunk.Shape</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pymunk-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://pymunk.googlecode.com/">pymunk API reference</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pymunk-module.html">Package&nbsp;pymunk</a> ::
        Class&nbsp;Shape
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pymunk.Shape-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Shape</h1><p class="nomargin-top"></p>
<pre class="base-tree">
object --+
         |
        <strong class="uidshort">Shape</strong>
</pre>

<dl><dt>Known Subclasses:</dt>
<dd>
      <ul class="subclass-list">
<li><a href="pymunk.Circle-class.html">Circle</a></li><li>, <a href="pymunk.Poly-class.html">Poly</a></li><li>, <a href="pymunk.Segment-class.html">Segment</a></li>  </ul>
</dd></dl>

<hr />
<p>Base class for all the shapes.</p>
<p>You usually dont want to create instances of this class directly but use
one of the specialized shapes instead.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Shape-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">shape</span>=<span class="summary-sig-default">None</span>)</span><br />
      x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__del__"></a><span class="summary-sig-name">__del__</span>(<span class="summary-sig-arg">self</span>)</span></td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="cache_bb"></a><span class="summary-sig-name">cache_bb</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Update and returns the bouding box of this shape</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="point_query"></a><span class="summary-sig-name">point_query</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">p</span>)</span><br />
      Check if the given point lies within the shape.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Shape-class.html#segment_query" class="summary-sig-name">segment_query</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">start</span>,
        <span class="summary-sig-arg">end</span>)</span><br />
      Check if the line segment from start to end intersects the shape.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Shape-class.html#sensor" class="summary-name">sensor</a><br />
      A boolean value if this shape is a sensor or not.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Shape-class.html#collision_type" class="summary-name">collision_type</a><br />
      User defined collision type for the shape.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Shape-class.html#group" class="summary-name">group</a><br />
      Shapes in the same non-zero group do not generate collisions.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Shape-class.html#layers" class="summary-name">layers</a><br />
      Shapes only collide if they are in the same bit-planes.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Shape-class.html#elasticity" class="summary-name">elasticity</a><br />
      Elasticity of the shape.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Shape-class.html#friction" class="summary-name">friction</a><br />
      Friction coefficient.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Shape-class.html#surface_velocity" class="summary-name">surface_velocity</a><br />
      The surface velocity of the object.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Shape-class.html#body" class="summary-name">body</a><br />
      The body this shape is attached to
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">shape</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  <dl class="fields">
    <dt>Overrides:
        object.__init__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="segment_query"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">segment_query</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">start</span>,
        <span class="sig-arg">end</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  <p>Check if the line segment from start to end intersects the shape.</p>
<p>Return either SegmentQueryInfo object or None</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== PROPERTY DETAILS ==================== -->
<a name="section-PropertyDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Property Details</span></td>
</tr>
</table>
<a name="sensor"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">sensor</h3>
  A boolean value if this shape is a sensor or not. Sensors only
call collision callbacks, and never generate real collisions.
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_get_sensor" class="summary-sig-name" onclick="show_private();">_get_sensor</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_set_sensor" class="summary-sig-name" onclick="show_private();">_set_sensor</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">is_sensor</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="collision_type"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">collision_type</h3>
  User defined collision type for the shape. See
add_collisionpair_func function for more information on when to use
this property
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_get_collision_type" class="summary-sig-name" onclick="show_private();">_get_collision_type</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_set_collision_type" class="summary-sig-name" onclick="show_private();">_set_collision_type</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">t</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="group"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">group</h3>
  Shapes in the same non-zero group do not generate collisions.
Useful when creating an object out of many shapes that you don't want
to self collide. Defaults to 0
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_get_group" class="summary-sig-name" onclick="show_private();">_get_group</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_set_group" class="summary-sig-name" onclick="show_private();">_set_group</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">group</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="layers"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">layers</h3>
  Shapes only collide if they are in the same bit-planes.
i.e. (a.layers &amp; b.layers) != 0. By default, a shape occupies all
32 bit-planes.
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_get_layers" class="summary-sig-name" onclick="show_private();">_get_layers</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_set_layers" class="summary-sig-name" onclick="show_private();">_set_layers</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">layers</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="elasticity"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">elasticity</h3>
  Elasticity of the shape. A value of 0.0 gives no bounce,
while a value of 1.0 will give a 'perfect' bounce. However due to
inaccuracies in the simulation using 1.0 or greater is not
recommended.
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_get_elasticity" class="summary-sig-name" onclick="show_private();">_get_elasticity</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_set_elasticity" class="summary-sig-name" onclick="show_private();">_set_elasticity</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">e</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="friction"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">friction</h3>
  Friction coefficient. Chipmunk (and therefor pymunk) uses the
Coulomb friction model, a value of 0.0 is frictionless.
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_get_friction" class="summary-sig-name" onclick="show_private();">_get_friction</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_set_friction" class="summary-sig-name" onclick="show_private();">_set_friction</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">u</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="surface_velocity"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">surface_velocity</h3>
  The surface velocity of the object. Useful for creating
conveyor belts or players that move around. This value is only used
when calculating friction, not resolving the collision.
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_get_surface_velocity" class="summary-sig-name" onclick="show_private();">_get_surface_velocity</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Shape-class.html#_set_surface_velocity" class="summary-sig-name" onclick="show_private();">_set_surface_velocity</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">surface_v</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="body"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">body</h3>
  The body this shape is attached to
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><i>unreachable</i>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pymunk-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://pymunk.googlecode.com/">pymunk API reference</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Tue Jan 05 20:00:32 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
